//
//  HPCache.h
//  HPNetworking
//
//  Created by phq on 2019/9/26.
//  Copyright © 2019 pixy. All rights reserved.
//

#import <Foundation/Foundation.h>
@class HPRequestModel;

@interface HPCache : NSObject


/**
 缓存接口数据 -------- v4.0

 @param data 接口数据
 @param uid 用户ID
 @param model 请求模型
 @return 缓存结果反馈
 */
- (BOOL)cacheData:(NSDictionary *_Nonnull)data userId:(NSString *_Nullable)uid model:(HPRequestModel *_Nullable)model;


/**
 获取接口缓存数据

 @param uid 用户ID
 @param model 请求模型
 @return 缓存数据
 */
- (NSDictionary *_Nullable)getCacheWithUserId:(NSString *_Nullable)uid model:(HPRequestModel *_Nullable)model;


/**
 删除一条缓存数据

 @param uid 用户ID
 @param model 请求模型
 @return 删除结果反馈
 */
- (BOOL)removeCacheUserId:(NSString *_Nullable)uid model:(HPRequestModel *_Nullable)model;


/**
 删除全部接口缓存数据

 @return 删除结果反馈
 */
- (BOOL)removeAllRequestCache;


@end


NS_ASSUME_NONNULL_BEGIN
@interface HPCache (Recode)
// save
- (BOOL)saveData:(NSDictionary *)data userId:(NSString *)uid funcTag:(NSString *)funcTag;
// get
- (NSDictionary *)getDataWithUserId:(NSString *)uid funcTag:(NSString *)funcTag;
// remove
- (BOOL)removeWithUserId:(NSString *)uid funcTag:(NSString *)funcTag;
// remove all
- (BOOL)removeAll;
@end
NS_ASSUME_NONNULL_END
